package com.tw.trips.domain.fixture;

import java.util.HashSet;
import java.util.Set;

import com.tw.trips.domain.Location;
import com.tw.trips.domain.Update;

public class LocationFixture {
	private Location location;

	public LocationFixture(String name, Set<Update> updates) {
		location = new Location();
		location.setName(name);
	}

	public Location create() {
		if (location == null)
			location = this.createChennai();
		return location;
	}

	private Location createChennai() {
		Set<Update> updates = new HashSet<Update>();
		updates.add(new UpdateFixture().create());
		LocationFixture fixture = new LocationFixture("Chennai", updates);
		return fixture.create();
	}

	public LocationFixture() {
		super();
	}
}
